import request from '@/utils/request';

export function list(data, query) {
  return request({
    url: '/web/monitor/audit/logininfor/page',
    method: 'post',
    data: data,
    params: query,
  });
}

// 删除登录日志
export function delLogininfor(infoId) {
  return request({
    url: '/web/monitor/audit/logininfor/delete/' + infoId,
    method: 'post',
  });
}

// 解锁用户登录状态
export function unlockLogininfor(userName) {
  return request({
    url: '/web/monitor/audit/logininfor/unlock/' + userName,
    method: 'get',
  });
}

// 清空登录日志
export function cleanLogininfor() {
  return request({
    url: '/web/monitor/audit/logininfor/clean',
    method: 'post',
  });
}

// 导出
export function exportLogininfor(data, params) {
  return request({
    url: '/web/monitor/audit/logininfor/export',
    method: 'post',
    data,
    params,
    responseType: 'blob',
    filename: `logininfor_${new Date().getTime()}.xlsx`,
  });
}
